package com.magnificent.atlantis.client.data.task.planner;

import com.magnificent.atlantis.client.data.message.messages.ClientInviteMessage;
import com.magnificent.atlantis.client.data.message.messages.ClientReInviteMessage;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import java.util.ArrayList;
import java.util.List;

/**
 * User: Babanin
 * Date: 05.05.2009
 * Time: 2:35:33
 */
public class CommunityMeetingPlannerTask extends SimpleMeetingPlannerTask {
    private int meetingId;
    private boolean isOwner;

    private List<Integer> invitedUsers;
    private List<Integer> acceptedUsers;
    private List<Integer> canceledUsers;

    public CommunityMeetingPlannerTask() {
    }

    public CommunityMeetingPlannerTask(ClientInviteMessage message) {
        setOwner(false);
        setMeetingId(message.getMeetingId());
        setInvitedUsers(message.getInvitedUsers());

        setStartDate(message.getDate());
        setName(message.getMeetingTitle());
        setDescription(message.getComment());
        setConfigurationId(message.getConfigurationId());
    }

    @XmlAttribute()
    public int getMeetingId() {
        return meetingId;
    }

    public void setMeetingId(int meetingId) {
        this.meetingId = meetingId;
    }

    @XmlAttribute()
    public boolean isOwner() {
        return isOwner;
    }

    public void setOwner(boolean owner) {
        isOwner = owner;
    }

    @XmlElement()
    public List<Integer> getInvitedUsers() {
        if (invitedUsers == null) {
            invitedUsers = new ArrayList<Integer>();
        }

        return invitedUsers;
    }

    public void setInvitedUsers(List<Integer> invitedUsers) {
        this.invitedUsers = invitedUsers;
    }

    @XmlElement()
    public List<Integer> getAcceptedUsers() {
        if (acceptedUsers == null) {
            acceptedUsers = new ArrayList<Integer>();
        }

        return acceptedUsers;
    }

    public void setAcceptedUsers(List<Integer> acceptedUsers) {
        this.acceptedUsers = acceptedUsers;
    }

    @XmlElement()
    public List<Integer> getCanceledUsers() {
        if (canceledUsers == null) {
            canceledUsers = new ArrayList<Integer>();
        }

        return canceledUsers;
    }

    public void setCanceledUsers(List<Integer> canceledUsers) {
        this.canceledUsers = canceledUsers;
    }
}
